package top.huhuiyu.springboot3.service.impl;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.huhuiyu.springboot3.entity.TbLogic;
import top.huhuiyu.springboot3.mapper.TbLogicMapper;
import top.huhuiyu.springboot3.service.TbLogicService;

import java.util.List;

@Service
@RequiredArgsConstructor
@Transactional
public class TbLogicServiceImpl implements TbLogicService {
    private final TbLogicMapper tbLogicMapper;

    @Override
    public int insert(TbLogic tbLogic) {
        return tbLogicMapper.insert(tbLogic);
    }

    @Override
    public List<TbLogic> query() {
        return tbLogicMapper.selectList(null);
    }

    @Override
    public List<TbLogic> queryDeleted() {
        return tbLogicMapper.queryDeleted();
    }

    @Override
    public int delete(TbLogic tbLogic) {
        return tbLogicMapper.deleteById(tbLogic);
    }


}
